from selenium import webdriver
#from selenium.webdriver.support.select import Select
import time
import xlrd
from datetime import date,datetime
import pymysql
from selenium.common.exceptions import NoSuchElementException
browser = webdriver.Chrome()
browser.get("http://10.22.26.34:8080/fwd/indexlis.jsp")
browser.maximize_window()
time.sleep(1)

def check_cancelBtn():
    print('check cancelBtn')
    try:
        #cancelBtn =driver.find_element_by_class_name("android.widget.Button")
        cancelBtn = browser.find_element_by_id("submit2")
    except NoSuchElementException:
        print('no cancelBtn')   #当没有这个元素就打印出no cancelBtn
    else:
        cancelBtn.click()   #存在这个元素就去点击


check_cancelBtn()

